import { Transform } from 'class-transformer';
import { IsDefined, Max, Min } from 'class-validator';

export class PayRechangeDto {
  @IsDefined({ message: '充值金额必填' })
  @Transform(({ value }) => Number(value))
  @Min(1, { message: '充值金额不能小于1元' })
  @Max(10000, { message: '单笔充值金额不能大于1万元' })
  amount: number;

  ip?: string;
}

export class PayQueryDto {
  @IsDefined({ message: '订单号必填' })
  no: string;
}
